<!--
 * @Author: cgl
 * @Date: 2023-04-18 15:12:26
 * @LastEditors: liangkun 2669681641@qq.com
 * @LastEditTime: 2023-11-17 15:35:31
 * @FilePath: \radiation-hygiene-fe\src\views\report\equipmentReport.vue
 * @Description:
 *
 * Copyright (c) 2023 by cgl/微盛信息产业有限公司, All Rights Reserved.
-->
<template>
  <div class="app-container">
    <el-form
      class="searchform"
      :model="queryParams"
      ref="queryParams"
      size="small"
      label-width="80px"
    >
      <el-row :gutter="20">
        <el-col :span="5">
          <el-form-item label="合同编号">
            <el-input
              v-model="queryParams.agreementNumber"
              placeholder="请输入"
              clearable
              @keyup.enter.native="getList()"
            />
          </el-form-item>
        </el-col>
        <el-col :span="5">
          <el-form-item label="联系人">
            <el-input
              v-model="queryParams.contactsName"
              placeholder="请输入"
              clearable
              @keyup.enter.native="getList()"
            />
          </el-form-item>
        </el-col>
        <el-col :span="5">
          <el-form-item label="状态">
            <el-select
              v-model="queryParams.tasksState"
              clearable
              style="width: 100%"
            >
              <el-option
                v-for="dict in filterDict"
                :key="dict.dictValue"
                :label="dict.dictLabel"
                :value="dict.dictValue"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="9">
          <el-form-item label-width="20px">
            <el-button
              type="primary"
              icon="el-icon-search"
              size="mini"
              @click="getList()"
              >搜索</el-button
            >
            <el-button icon="el-icon-refresh" size="mini" @click="reset()"
              >重置</el-button
            >
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>

    <div class="table-wrapper">
      <el-table
        height="300px"
        v-loading="loading"
        :data="dataList"
        @row-dblclick="(row) => openhandleDialog(row, '3')"
      >
        <el-table-column label="序号" type="index" align="center" >
          <template slot-scope="scope">
            <div style="text-align: center;">{{ scope.$index+1 }}</div>
          </template>
        </el-table-column>
        <el-table-column
          label="合同编号"
          align="center"
          prop="agreementNumber"
        />
        <el-table-column
          label="委托单位"
          align="center"
          prop="organizationName"
          :show-overflow-tooltip="true"
        />
        <el-table-column
          label="联系人"
          align="center"
          prop="contactsName"
          width="120"
        />
        <el-table-column
          label="联系电话"
          align="center"
          prop="contactsMobile"
          width="150"
        />
        <el-table-column
          label="单位地址"
          align="center"
          prop="organizationAddress"
          width="150"
          :show-overflow-tooltip="true"
        />
        <el-table-column label="录入时间" align="center" prop="createTime" />
        <el-table-column align="center" label="是否生成报告">
          <template slot-scope="{ row }">
            <span style="color: green" v-if="row.tasksState == '2'">
              已出报告
            </span>
            <span style="color: #2a72ee" v-else> 待出报告 </span>
          </template>
        </el-table-column>
        <el-table-column label="状态" align="center">
          <template slot-scope="scope">
            <dict-tag
              :value="scope.row.tasksState"
              :options="dict.type.person_report_status"
            ></dict-tag>
          </template>
        </el-table-column>
        <el-table-column align="center" label="操作">
          <template slot-scope="scope">
            <el-button
              type="text"
              class="ovbutton"
              @click="downloadReport(scope.row.ossId)"
              v-if="scope.row.tasksState == '2' && scope.row.ossId"
            >
              下载报告
            </el-button>
          </template>
        </el-table-column>
      </el-table>

      <pagination
        v-show="total > 0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
      />
    </div>

    <!-- 任务弹框 -->
    <el-dialog
      :title="title"
      :visible.sync="dialogVisible"
      :close-on-click-modal="false"
      width="1500px"
      v-dialogDrag="true"
    >
      <el-form
        :model="form"
        disabled
        :rules="rules"
        ref="form"
        size="small"
        label-width="80px"
      >
        <el-row :gutter="40">
          <el-col :span="8">
            <el-form-item label="单位名称" prop="entrustOrganizationId">
              <!-- <el-select
								v-model="form.entrustOrganizationId"
								:placeholder="status != '3' ? '输入文字检索查询' : ''"
								style="width: 100%"
								filterable
								@change="changeEntrustOrganization"
								clearable>
								<el-option
									:label="item.organizationName"
									:value="item.entrustOrganizationId"
									v-for="(item,index) in entrustOrganizationSelect"
									:key="index">
								</el-option>
							</el-select> -->
              <m-select
                v-model="form.entrustOrganizationId"
                :placeholder="status != '3' ? '输入文字检索查询' : ''"
                style="width: 95%"
                filterable
                :disabled="!isPer"
                @change="changeEntrustOrganization"
                clearable
                :lists="entrustOrganizationSelect"
                lists_label="organizationName"
                lists_value="entrustOrganizationId"
                lists_key="entrustOrganizationId"
                :total="orgTotal"
                :pageSize="10"
                @handleChange="listeningEvent"
              >
              </m-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="合同编号">
              <el-select
                v-model="form.agreementNumber"
                ref="agreement"
                @change="changeAgreement"
                placeholder=""
                style="width: 100%"
                clearable
              >
                <el-option
                  :label="item.agreementNumber"
                  :value="item.agreementNumber"
                  v-for="(item, index) in agreementList"
                  :key="index"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="联系人">
              <el-input v-model="form.contactsName" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="联系电话">
              <el-input v-model="form.contactsMobile" />
            </el-form-item>
          </el-col>
          <el-col :span="16">
            <el-form-item label="单位地址" prop="provinceCode">
              <el-input v-model="form.organizationAddress" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>

      <div class="innertitle">
        <el-button
          class="addline"
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click.native.prevent="addline()"
          v-if="status == '1'"
          >添加</el-button
        >
      </div>
      <el-table
        :data="form.tasksContractEquipmentList"
        height="414"
        class="handletabel"
        :cell-class-name="tableCellClassName"
        @selection-change="handleSelectionChange"
        @row-dblclick="(row) => openDialog(row, '3')"
      >
        <el-table-column label="序号" type="index" align="center" width="50">
          <template slot-scope="scope">
            {{ scope.$index + 1 }}
          </template>
        </el-table-column>
        <el-table-column
          label="设备名称"
          align="center"
          prop="equipmentName"
          width="150"
        >
          <template slot-scope="scope">
            <!-- <el-select
								@change="changeUnhandledEquipment($event, scope.row)"
								v-if="scope.row.index + ',' + scope.column.index == currentCell"
								v-model="scope.row.entrustEquipmentId"
								style="width: 100%"
								size="mini"
								:ref="`select_${scope.$index}`"
								clearable>
								<el-option
									:label="item.equipmentName"
									:value="item.entrustEquipmentId"
									v-for="(item,index) in unHandleEquipmentList"
									:key="index">
								</el-option>
							</el-select> -->

            <span>
              {{ scope.row.equipmentName }}
            </span>
          </template>
        </el-table-column>
        <el-table-column
          label="设备编号"
          align="center"
          prop="equipmentNumber"
          width="150"
        />
        <el-table-column
          label="规格及型号"
          align="center"
          prop="specificationModel"
          width="100"
        />
        <el-table-column
          label="生产厂家"
          align="center"
          prop="manufacturerName"
        />
        <el-table-column label="使用场所" align="center" prop="usePlace" />
        <el-table-column
          label="检测类别"
          align="center"
          prop="inspectionTypeId"
          width="450"
        >
          <template slot-scope="scope">
            <div
              v-if="
                scope.row.inspectionTypeNameList &&
                scope.row.inspectionTypeNameList.length != 0
              "
            >
              <span
                v-for="(item, index) in scope.row.inspectionTypeNameList"
                :key="index"
              >
                {{ item }}
                <span
                  v-if="
                    scope.row.inspectionTypeNameList.length != 0 &&
                    index != scope.row.inspectionTypeNameList.length - 1
                  "
                >
                  、
                </span>
              </span>
            </div>

            <!-- <div v-else-if="status == '1'" class="inspect">
								<el-checkbox-group @change="changeInspectId(scope.row)" :disabled="status == '3'" class="inspectcheckbox" v-model="scope.row.CG" v-if="scope.row.equipmentName && scope.row.equipmentName.includes('个人剂量')">
									<el-checkbox v-for="(item, index) in CGInspectList" :key="index" :label="item.inspectionTypeId">{{item.typeName}}</el-checkbox>
								</el-checkbox-group>

								<el-checkbox-group @change="changeInspectId(scope.row)" :disabled="status == '3'" class="inspectcheckbox" v-model="scope.row.FH" v-if="scope.row.equipmentName && !scope.row.equipmentName.includes('个人剂量')">
									<el-checkbox v-for="(item, index) in FHInspectList" :key="index" :label="item.inspectionTypeId">{{item.typeName}}</el-checkbox>
								</el-checkbox-group>
								<el-radio-group :disabled="status == '3'" class="inspectradio" v-model="scope.row.radioInspecId" v-if="scope.row.equipmentName && !scope.row.equipmentName.includes('个人剂量')">
									<el-radio v-for="(item, index) in radioInspectList" :key="index" :label="item.inspectionTypeId" @click.native.prevent="handleChangeRadioInspecId(scope.row, scope.$index, item.inspectionTypeId)">{{item.typeName}}</el-radio>
								</el-radio-group>
							</div> -->
          </template>
        </el-table-column>
        <el-table-column
          label="现场记录"
          align="center"
          :show-overflow-tooltip="true"
        >
          <template slot-scope="scope">
            <span
              @click="viewFile(scope.row.inputOssIdUrl)"
              v-if="scope.row.inputOssIdUrl"
              class="viewfile"
              >查看</span
            >
            &nbsp;
            <span
              @click="viewFile(scope.row.cbctInputOssIdUrl)"
              v-if="scope.row.cbctInputOssIdUrl"
              class="viewfile"
              >CBCT查看</span
            >
          </template>
        </el-table-column>
        <el-table-column
          label="检测报告"
          align="center"
          :show-overflow-tooltip="true"
        >
          <template slot-scope="scope">
            <span
              @click="viewFile(scope.row.ossIdUrl)"
              v-if="scope.row.ossIdUrl"
              class="viewfile"
              >查看</span
            >
            &nbsp;
            <span
              @click="viewFile(scope.row.cbctOssIdUrl)"
              v-if="scope.row.cbctOssIdUrl"
              class="viewfile"
              >CBCT查看</span
            >
          </template>
        </el-table-column>
        <el-table-column
          v-if="status == '1'"
          align="center"
          width="200"
          label="操作"
        >
          <template slot-scope="scope">
            <div class="cusoperation">
              <el-button
                v-if="scope.row.entrustEquipmentId"
                @click.native.prevent="openDialog(scope.row)"
                type="text"
              >
                录入
              </el-button>
              <el-button
                v-if="scope.row.entrustEquipmentId"
                @click.native.prevent="generateReport(scope.row, 1)"
                type="text"
              >
                下载现场记录
              </el-button>
              <el-button
                v-if="scope.row.entrustEquipmentId"
                @click.native.prevent="generateReport(scope.row, 2)"
                type="text"
              >
                生成检测报告
              </el-button>
              <el-button
                v-if="scope.row.entrustEquipmentId"
                @click.native.prevent="deleteData(scope.row, scope.$index)"
                type="text"
                style="color: #f32d2d"
              >
                删除
              </el-button>
            </div>
          </template>
        </el-table-column>
      </el-table>

      <pagination
        calss="handlepagination"
        style="margin-bottom: 69px"
        v-show="totalHandle > 0"
        :total="totalHandle"
        :page.sync="queryParamsHandle.pageNum"
        :limit.sync="queryParamsHandle.pageSize"
        @pagination="getHandleDataList"
      />

      <div slot="footer">
        <el-button type="primary" v-if="status == '1'" @click="handle(1)"
          >办 理</el-button
        >
        <el-button type="success " v-if="status == '2'" @click="handle(1)"
          >通 过</el-button
        >
        <el-button
          type="danger"
          v-if="status == '2'"
          @click="handle(2)"
          style="margin-right: 50px"
          >驳 回</el-button
        >
        <el-button @click="dialogVisible = false">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 录入弹框 -->
    <el-dialog
      :title="titleEquipment"
      :visible.sync="dialogVisibleEquipment"
      width="1240px"
      class="dialogVisibleEquipment"
      :destroy-on-close="true"
      v-dialogDrag="true"
    >
      <el-tabs
        v-model="activeNameEquipment"
        @tab-click="changeTabEquipment"
        class="tabEquipment"
      >
        <el-tab-pane
          v-for="(item, index) in tabList"
          :key="index"
          :label="item.label"
          :name="item.name"
        ></el-tab-pane>
      </el-tabs>

      <!-- 加载状态 -->
      <div class="loadingquery" v-if="isonblur">
        <div class="progressbox" v-if="loadingquery">
          <div class="isloading" v-loading="true"></div>
        </div>
        <div class="progressbox" v-else>
          <el-progress
            :stroke-width="2"
            :width="25"
            text-color="#13ce66"
            type="circle"
            :percentage="100"
            status="success"
          ></el-progress>
        </div>
      </div>

      <div class="content" ref="scrollref">
        <div :class="lrstatus == '3' && 'mask'">
          <itemIndex
            :key="basicForm.basicInfoCode"
            :opendialogRow="opendialogRow"
            :basicForm="basicForm"
            :activeNameEquipment="activeNameEquipment"
            :lrstatus="lrstatus"
            :inspectionList="inspectionList"
            @loadingchange="loadingchange"
          ></itemIndex>
        </div>
      </div>

      <div slot="footer">
        <el-button @click="dialogVisibleEquipment = false">关 闭</el-button>
      </div>
    </el-dialog>

    <!-- 添行弹框 -->
    <el-dialog
      title="添加设备"
      :visible.sync="addLineVisible"
      width="1000px"
      v-dialogDrag="true"
    >
      <el-form
        :model="addlineForm"
        :rules="addlineFormRule"
        ref="addlineform"
        size="small"
        label-width="100px"
      >
        <el-row>
          <el-col :span="8">
            <el-form-item label="设备名称" prop="entrustEquipmentId">
              <el-select
                @change="changeUnhandledEquipment"
                v-model="addlineForm.entrustEquipmentId"
                style="width: 100%"
                ref="selectEquipment"
              >
                <el-option
                  :label="item.equipmentName"
                  :value="item.entrustEquipmentId"
                  v-for="(item, index) in unHandleEquipmentList"
                  :key="index"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="16">
            <el-form-item
              class="star"
              label="检测类型"
              prop=""
              label-width="160px"
            >
              <div v-if="addlineForm.equipmentName">
                <div class="inspect">
                  <el-checkbox-group
                    class="inspectcheckbox"
                    v-model="addlineForm.CG"
                    v-if="addlineForm.equipmentName.includes('个人剂量')"
                  >
                    <el-checkbox
                      v-for="(item, index) in CGInspectList"
                      :key="index"
                      :label="item.inspectionTypeId"
                      >{{ item.typeName }}</el-checkbox
                    >
                  </el-checkbox-group>

                  <el-checkbox-group
                    class="inspectcheckbox"
                    v-model="addlineForm.FH"
                    v-if="!addlineForm.equipmentName.includes('个人剂量')"
                  >
                    <el-checkbox
                      v-for="(item, index) in FHInspectList"
                      :key="index"
                      :label="item.inspectionTypeId"
                      >{{ item.typeName }}</el-checkbox
                    >
                  </el-checkbox-group>
                  <el-radio-group
                    class="inspectradio"
                    v-model="addlineForm.radioInspecId"
                    v-if="!addlineForm.equipmentName.includes('个人剂量')"
                  >
                    <el-radio
                      v-for="(item, index) in radioInspectList"
                      :key="index"
                      :label="item.inspectionTypeId"
                      @click.native.prevent="
                        handleChangeRadioInspecId(item.inspectionTypeId)
                      "
                      >{{ item.typeName }}</el-radio
                    >
                  </el-radio-group>
                </div>
              </div>

              <div v-else style="color: #c0c4cc; padding-left: 20px">
                请先选择设备名称
              </div>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer">
        <el-button type="primary" @click="submitAddline">确 定</el-button>
        <el-button @click="addLineVisible = false">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  detectionEquipmentList,
  detectionEquipmentDetail,
  getHandleData,
  handle,
  getUnHandleEquipmentList,
  removeResult,
  addResult,
  getResultInfo,
  submit,
  generateInputReport,
  generateTestReport,
  updateInspectionType,
} from "@/api/testItem/detectionResult";
import {
  personalDosimeterReportList,
  detectionEquipmentReportList,
} from "@/api/report/report";
import { getInspectionList } from "@/api/slides/contractTask";
import { equipmentListAll } from "@/api/equipment/equipment";
import { equipmentCertificateListing } from "@/api/resourse/equipmentCertificate";
import { entrustEquipmentListing } from "@/api/person/entrustEquipment";
import { getAgreementListWithTaskTogether } from "@/api/person/entrustAgreement";
import { getAgreementListWithTaskDosimeter } from "@/api/person/entrustAgreement";
import {
  entrustOrganizationListing,
  entrustOrganizationList,
} from "@/api/person/entrustOrganization";
import { entrustEquipmentTypeListing } from "@/api/person/entrustEquipmentType";
import { listOss, listByIds, delOss } from "@/api/system/oss";
import { getDicts } from "@/api/system/dict/data";
import MSelect from "@/components/mSelect";

export default {
  name: "equipmentTask",
  dicts: ["person_report_status"],
  components: { MSelect },
  data() {
    return {
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
      total: 0,
      dialogVisible: false,
      // 表单参数
      form: {},
      loading: false,
      status: null,
      title: null,
      rules: {
        entrustOrganizationId: [
          { required: false, message: "单位名称不能为空", trigger: "blur" },
        ],
      },
      // 委托单位下拉框
      entrustOrganizationSelect: [],
      // 设备类型下拉框
      entrustEquipmentTypeSelect: [],
      // 检测类型下拉框
      inspectionList: [],
      CGInspectList: [],
      FHInspectList: [],
      radioInspectList: [],
      activeName: "-4",
      // 办理弹框
      dialogVisiblehandle: false,
      handleform: {},
      // 删除的人员
      deletePerson: [],
      // 合同下拉框
      agreementList: [],
      // 打开的当行id
      handleId: null,
      loadingHandle: false,
      btnLoading: false,
      // 添加的查询参数
      queryParamsAdd: {
        pageNum: 1,
        pageSize: 10,
      },
      totalAdd: 0,
      // 打开的当行id
      addId: null,
      loadingAdd: false,
      isPer: false,
      // 视图高度
      height: document.documentElement.clientHeight,
      addlineFormRule: {
        entrustEquipmentId: [
          { required: true, message: "设备名称不能为空", trigger: "change" },
        ],
      },
      dialogVisibleEquipment: false,
      activeNameEquipment: "0",
      titleEquipment: "",
      remarks: "",
      dataList: [{}],
      checked: [],
      basicInfo: {},
      equipmentType: "06",
      // 总列表
      dataList: [],
      // 委托单位设备下拉框
      entrustEquipmentSelect: [],
      lrstatus: null,
      // 基本信息数据
      basicForm: {},
      basicInfo: {},
      // 未办理设备列表（进行添加）
      unHandleEquipmentList: [],
      // 失焦触发请求
      isonblur: false,
      // 请求加载状态
      loadingquery: false,
      // 索引
      currentCell: null,
      // 外层打开的行
      openRow: {},
      // 办理设备的查询参数
      queryParamsHandle: {
        pageNum: 1,
        pageSize: 10,
      },
      totalHandle: 0,
      opendialogRow: {},
      equipmentTitleList: [
        {
          basicInfoCode: "01",
          title: "X射线透视设备质量控制检测现场记录",
        },
        {
          basicInfoCode: "05",
          title: "X射线摄影设备质量控制检测现场记录",
        },
        {
          basicInfoCode: "06",
          title: "数字X射线摄影设备（DR）质量控制检测现场记录",
        },
        {
          basicInfoCode: "09",
          title: "牙科X射线设备质量控制检测项目",
        },
        {
          basicInfoCode: "11",
          title: "乳腺CR设备质量控制检测现场记录",
        },
        {
          basicInfoCode: "12",
          title: "乳腺数字X射线摄影设备质量控制检测现场记录",
        },
      ],
      testItemList: [
        {
          name: "01",
          label: "透视通用检测项目",
        },
        {
          name: "02",
          label: "直接荧光屏透视设备专用项目",
        },
        {
          name: "03",
          label: "DSA设备专用项目",
        },
        {
          name: "04",
          label: "X射线摄影设备通用检测项目",
        },
        {
          name: "05",
          label: "屏片X射线摄影设备专用检测项目",
        },
        {
          name: "06",
          label: "DR设备专用检测项目",
        },
        {
          name: "07",
          label: "CR设备专用检测项目",
        },
        {
          name: "08",
          label: "牙科X射线设备质量控制检测项目",
        },
        {
          name: "09",
          label: "乳腺摄影通用检测项目",
        },
        {
          name: "10",
          label: "乳腺屏片X射线摄影设备专用检测项目",
        },
        {
          name: "11",
          label: "乳腺DR专用检测项目",
        },
        {
          name: "12",
          label: "乳腺CR设备专用检测项目",
        },
        {
          name: "20",
          label: "检测结果",
        },
        {
          name: "21",
          label: "检测结果",
        },
        {
          name: "22",
          label: "检测结果",
        },
      ],
      // tab栏
      tabList: [],
      // 存储scrollTop
      scrollTopList: [],
      addLineVisible: false,
      addlineForm: {},
      // 仪器
      equipmentLists: [],
      // 状态字典
      filterDict: [],
      // 单位查询数据
      organizationQueryData: {
        organizationName: "", //单位名称模糊查询
        pageNum: 1, //页码
        pageSize: 10, //每页展示的条数
      },
      orgTotal: 0,
    };
  },
  provide() {
    return {
      app: this,
    };
  },
  inject: ["getAppLoading"],
  computed: {
    app_loading() {
      return this.getAppLoading();
    },
  },
  created() {
    this.getDict();
    this.getList();
    window.addEventListener("resize", () => {
      this.height = document.documentElement.clientHeight;
    });

    this.$on("hook:destroyed", () => {
      // console.log('clear height')
      window.removeEventListener("resize", () => {
        this.height = document.documentElement.clientHeight;
      });
    });
  },
  methods: {
    // 获取状态字典(去除已收样)
    getDict() {
      getDicts("person_report_status").then((response) => {
        this.filterDict =
          response.data.filter((item) => item.dictLabel != "待收样") || [];
      });
    },
    // 获取总列表
    getList() {
      this.loading = true;
      detectionEquipmentReportList(this.queryParams)
        .then((response) => {
          this.dataList = response.rows;
          this.total = response.total;
          this.loading = false;
        })
        .catch((response) => {
          this.loading = false;
        });
    },
    // 获取设备类型下拉框
    getEntrustEquipmentTypeListing() {
      entrustEquipmentTypeListing().then((response) => {
        this.entrustEquipmentTypeSelect = response.data;
      });
    },
    // 获取检测类型下拉框
    getInspectionListing() {
      getInspectionList().then((response) => {
        this.inspectionList = response.rows;
        this.CGInspectList = this.inspectionList.filter((item) => {
          return item.typeName == "常规监测";
        });
        this.FHInspectList = this.inspectionList.filter((item) => {
          return item.typeName == "防护检测";
        });
        this.radioInspectList = this.inspectionList.filter((item) => {
          return item.typeName != "常规监测" && item.typeName != "防护检测";
        });
      });
    },
    // 获取委托单位设备下拉框
    getEntrustEquipmentListing() {
      entrustEquipmentListing().then((response) => {
        this.entrustEquipmentSelect = response.data;
      });
    },
    // 获取单位下拉框
    listeningEvent(e) {
      let { queryName, pageNum, pageSize, type } = e;
      if (type == "scroll" && pageNum == this.organizationQueryData.pageNum)
        return;
      this.organizationQueryData.organizationName = queryName;
      this.organizationQueryData.pageNum = pageNum;
      this.organizationQueryData.pageSize = pageSize;
      entrustOrganizationList(this.organizationQueryData).then((response) => {
        if (type == "scroll") {
          this.entrustOrganizationSelect.push(...response.rows);
        } else {
          this.entrustOrganizationSelect = response.rows;
        }
        this.orgTotal = response.total;
      });
    },
    // 下载报告
    downloadReport(ossId) {
      listByIds(ossId).then((response) => {
        let lastIndex = response.data[0].url.lastIndexOf(".");
        let suffix = response.data[0].url.substring(lastIndex + 1);
        console.log("后缀", suffix);
        let data = {
          url: response.data[0].url,
          name: response.data[0].originalName,
          type: suffix,
        };
        fetch(data.url, {
          method: "get",
          mode: "cors",
        })
          .then((response) => response.blob())
          .then((res) => {
            const downloadUrl = window.URL.createObjectURL(
              //new Blob() 对后端返回文件流类型处理
              new Blob([res], {
                type:
                  data.type == "pdf"
                    ? "application/pdf"
                    : data.type == "docx"
                    ? "application/msword"
                    : data.type == "xlsx"
                    ? "application/vnd.ms-excel"
                    : "",
              })
            );
            //word文档为msword,pdf文档为pdf
            const link = document.createElement("a");
            link.href = downloadUrl;
            link.setAttribute("download", data.name);
            document.body.appendChild(link);
            link.click();
            link.remove();
          })
          .catch((error) => {
            window.open(data.url);
          });
      });
    },
    // 打开任务对话框
    openhandleDialog(row, status) {
      this.btnLoading = true;
      this.openRow = row;
      this.form = {
        tasksContractEquipmentList: [],
      };
      this.resetForm("form");
      this.currentCell = null;
      detectionEquipmentDetail(row.taskDetectionEquipmentId).then(
        (response) => {
          this.form = response.data || {};
          if (this.form.entrustOrganizationId) {
            getAgreementListWithTaskTogether({
              entrustOrganizationId: this.form.entrustOrganizationId,
            }).then((response) => {
              this.agreementList = response.data;
            });
          }
          this.queryParamsHandle = {
            id: row.taskDetectionEquipmentId,
            pageNum: 1,
            pageSize: 10,
          };
          this.getHandleDataList();
        }
      );
      this.status = status;
      if (this.status == "1") {
        this.title = "办理设备任务";
      }
      if (this.status == "2") {
        this.title = "审核设备任务";
      }
      if (this.status == "3") {
        this.title = "查看设备任务";
      }
    },
    // 获取办理设备列表
    getHandleDataList() {
      getHandleData(this.queryParamsHandle).then((response) => {
        let responsedata = response.rows || [];
        this.totalHandle = response.total;
        responsedata.forEach((item) => {
          item.inspectionTypeNameList = [];
          let arr =
            (item.inspectionTypeId && item.inspectionTypeId.split(",")) || [];
          if (arr.length != 0) {
            arr.forEach((id) => {
              let findobj = this.inspectionList.find(
                (item) => id == item.inspectionTypeId
              );
              if (findobj) {
                item.inspectionTypeNameList.push(findobj.typeName);
              }
            });
          } else {
            item.CG = [];
            item.FH = [];
            item.radioInspecId = null;
          }

          if (item.inputOssId) {
            /* 现场记录 */
            listByIds(item.inputOssId).then((response) => {
              this.$set(item, "inputOssIdUrl", response.data[0].url);
            });
          }
          if (item.ossId) {
            /* 检测报告 */
            listByIds(item.ossId).then((response) => {
              this.$set(item, "ossIdUrl", response.data[0].url);
            });
          }

          if (item.cbctInputOssId) {
            /* 现场记录 */
            listByIds(item.cbctInputOssId).then((response) => {
              this.$set(item, "cbctInputOssIdUrl", response.data[0].url);
            });
          }
          if (item.cbctOssId) {
            /* 检测报告 */
            listByIds(item.cbctOssId).then((response) => {
              this.$set(item, "cbctOssIdUrl", response.data[0].url);
            });
          }
        });
        this.$set(this.form, "tasksContractEquipmentList", responsedata);
        // console.log("this.form", this.form);
        this.btnLoading = false;
        this.dialogVisible = true;
      });
    },
    viewFile(url) {
      console.log("url", url);
      if (url) {
        window.open(url, "PDF", "");
      } else {
        this.$modal.msgWarning("暂无文件");
      }
    },
    // 查询所有仪器
    getEquipmentList() {
      equipmentListAll().then((response) => {
        this.equipmentLists = response.rows;
      });
    },
    /***
     * 根据编号查询仪器下拉框
     * type 1 普通基本信息
     * type 2 录入基本信息
     */
    codeFilterInstrument(type = 1) {
      let changeData;
      let { equipmentLists } = this;
      if (type === 1) {
        if (!this.basicForm.instrumentationObject) {
          return;
        }
        changeData = [...this.basicForm.instrumentationObject];
      }
      if (type === 2) {
        if (!this.basicForm.protectionDetectionVo.instrumentationObject) {
          return;
        }
        changeData = [
          ...this.basicForm.protectionDetectionVo.instrumentationObject,
        ];
      }

      changeData.forEach((item) => {
        let filterQuuipment = equipmentLists.filter(
          (list) => list.instrumentTypeCode == item.code
        );
        this.$set(item, "equipmentList", filterQuuipment);
        // 绑定的证书列表
        if (item.certificateEntities) {
          this.$set(
            item,
            "vm_cerIdList",
            item.certificateEntities.map((item) => item.equipmentCertificateId)
          );
        } else {
          this.$set(item, "vm_cerIdList", []);
        }
        // 证书列表下拉框
        if (item.equipmentId) {
          equipmentCertificateListing(item.equipmentId).then((response) => {
            this.$set(item, "certificateList", response.data);
          });
        } else {
          this.$set(item, "certificateList", []);
        }
      });

      if (type == 1) {
        this.$set(this.basicForm, "instrumentationObject", changeData);
      } else if (type == 2) {
        this.$set(
          this.basicForm.protectionDetectionVo,
          "instrumentationObject",
          changeData
        );
      }
    },
    // 打开录入对话框
    openDialog(row, status) {
      this.lrstatus = status;
      this.opendialogRow = row;
      this.isonblur = false;
      getResultInfo(row.taskDetectionEquipmentResultId).then((response) => {
        this.basicForm = response.data || {};
        if (!this.basicForm.basicInfoCode) {
          this.$modal.msgWarning("暂无设备信息");
          return;
        }
        if (!this.basicForm.basicInfo) {
          this.basicForm.basicInfo = {};
        }
        if (!this.basicForm.standard) {
          this.basicForm.standard = {
            defaultStandard: [],
            otherStandard: [],
          };
        }
        if (!this.basicForm.inspectionTypeId) {
          this.$set(this.basicForm, "inspectionTypeIdList", []);
        } else {
          this.$set(
            this.basicForm,
            "inspectionTypeIdList",
            this.basicForm.inspectionTypeId.split(",")
          );
        }
        // 根据编号查询仪器下拉框
        this.codeFilterInstrument();

        let tabList;
        // 录入tab
        if (row?.taskDetectionEquipmentResultId) {
          this.basicForm.resultId = row.taskDetectionEquipmentResultId;
          // 绑定的检测标准列表
          this.$set(
            this.basicForm.standard,
            "vm_otherStandardList",
            this.basicForm?.standard?.otherStandard?.map((item) => item.id) ||
              []
          );
          let findobj = this.equipmentTitleList.find(
            (item) => item.basicInfoCode == this.basicForm.basicInfoCode
          );
          if (findobj) {
            this.titleEquipment =
              this.lrstatus == "3" ? "查看" : "" + findobj.title;
          }
          let arr = this.basicForm.qualityControlCodes?.split(",") || [];
          tabList = [
            {
              label: "基本信息",
              name: "0",
            },
          ];
          arr.forEach((item) => {
            let obj = this.testItemList.find((it) => it.name == item);
            obj ? tabList.push(obj) : "";
          });
        }

        // 防护tab
        if (this.basicForm?.protectionDetectionVo) {
          this.basicForm.protectionDetectionVo.basicInfo =
            this.basicForm.protectionDetectionVo.basicInfo || {};
          // this.basicForm.resultId = row.protectionDetectionVo.taskDetectionEquipmentResultId;
          let protectionDetectionVo =
            this.testItemList.find(
              (it) =>
                it.name ==
                this.basicForm.protectionDetectionVo.qualityControlCodes
            ) || {};
          tabList = [
            ...tabList,
            ...[
              {
                label: "防护基本信息",
                name: "index",
              },
              protectionDetectionVo,
            ],
          ];
          // 根据编号查询仪器下拉框
          this.codeFilterInstrument(2);
        }

        this.basicForm = { ...this.basicForm };
        this.tabList = tabList;
        this.dialogVisibleEquipment = true;
        this.activeNameEquipment = "0";
        this.$nextTick(() => {
          this.scrollTopList = [];
          this.$refs["scrollref"].addEventListener(
            "scroll",
            (e) => {
              let findobj = this.scrollTopList.find((item) => {
                return item.name == this.activeNameEquipment;
              });
              if (findobj) {
                findobj.scrollTop = this.$refs["scrollref"].scrollTop;
              } else {
                this.scrollTopList.push({
                  name: this.activeNameEquipment,
                  scrollTop: this.$refs["scrollref"].scrollTop,
                });
              }
            },
            true
          );
        });
      });
    },
    // 组件的更新请求状态
    loadingchange(val) {
      this.isonblur = true;
      this.loadingquery = val;
    },
    // 删除设备任务
    deleteData(row, index) {
      this.$modal
        .confirm(`是否确认删除该设备？`)
        .then(() => {
          return removeResult(row.taskDetectionEquipmentResultId);
        })
        .then(() => {
          this.$modal.msgSuccess("删除成功");
          this.form.tasksContractEquipmentList.splice(index, 1);
        });
    },
    // 办理
    handle(type) {
      handle({
        id: this.openRow.taskDetectionEquipmentId,
        operation: type,
      }).then((response) => {
        this.$modal.msgSuccess("操作成功");
        this.dialogVisible = false;
      });
    },
    // 给单元格绑定横向和竖向的index，这样就能确定是哪一个单元格
    tableCellClassName({ row, column, rowIndex, columnIndex }) {
      row.index = rowIndex;
      column.index = columnIndex;
    },
    // 添行
    addline() {
      // console.log("this.form.tasksContractEquipmentList[this.form.tasksContractEquipmentList.length - 1].entrustEquipmentId", this.form.tasksContractEquipmentList[this.form.tasksContractEquipmentList.length - 1]);
      // if(this.form.tasksContractEquipmentList.length !== 0 &&
      // 		!this.form.tasksContractEquipmentList[this.form.tasksContractEquipmentList.length - 1].entrustEquipmentId) {
      // 	this.$modal.msgWarning("有未选择的设备");
      // 	return;
      // }
      // getUnHandleEquipmentList(this.openRow.taskDetectionEquipmentId).then((response) => {
      // 	this.unHandleEquipmentList = response.data || [];
      // 	if (this.unHandleEquipmentList.length == 0) {
      // 		this.$modal.msgWarning("暂无可添加的设备");
      // 		return;
      // 	}
      // 	this.form.tasksContractEquipmentList.push(
      // 		{
      // 			CG: [],
      // 			FH: [],
      // 			radioInspecId: null,
      // 		}
      // 	);
      // 	this.currentCell = this.form.tasksContractEquipmentList.length - 1 + ',' + 1;
      // 	setTimeout(() => {
      // 		this.$refs[`select_${this.form.tasksContractEquipmentList.length - 1}`].focus();
      // 	})
      // });

      getUnHandleEquipmentList(this.openRow.taskDetectionEquipmentId).then(
        (response) => {
          this.unHandleEquipmentList = response.data || [];
          if (this.unHandleEquipmentList.length == 0) {
            this.$modal.msgWarning("暂无可添加的设备");
            return;
          }
          this.addLineVisible = true;
          this.resetForm("addlineform");
          this.addlineForm = {
            CG: [],
            FH: [],
            radioInspecId: null,
          };
        }
      );
    },
    // 更改未办理设备
    changeUnhandledEquipment(val, row) {
      // addResult(this.openRow.taskDetectionEquipmentId, val).then(response => {
      // 	this.$modal.msgSuccess("添加成功");
      // 	this.getHandleDataList();
      // 	this.currentCell = null;
      // })

      this.$nextTick(() => {
        this.$set(
          this.addlineForm,
          "equipmentName",
          this.$refs["selectEquipment"].selectedLabel
        );
      });
    },
    // 添加设备
    submitAddline() {
      this.$refs["addlineform"].validate((valid) => {
        if (!valid) return;
        if (
          this.addlineForm.CG.length == 0 &&
          this.addlineForm.FH.length == 0 &&
          !this.addlineForm.radioInspecId
        ) {
          this.$modal.msgWarning("检测类型不能为空");
          return;
        }

        let arr = [];
        if (this.addlineForm.CG.length != 0) {
          arr.push(...this.addlineForm.CG);
        }
        if (this.addlineForm.FH.length != 0) {
          arr.push(...this.addlineForm.FH);
        }
        if (this.addlineForm.radioInspecId) {
          arr.push(this.addlineForm.radioInspecId);
        }
        addResult({
          id: this.openRow.taskDetectionEquipmentId,
          equipmentId: this.addlineForm.entrustEquipmentId,
          instrumentTypeId: arr.join(","),
        }).then((response) => {
          this.$modal.msgSuccess("添加成功");
          this.getHandleDataList();
          this.addLineVisible = false;
        });
      });
    },
    // 更改委托单位下拉
    changeEntrustOrganization(val) {
      let obj = this.entrustOrganizationSelect.find((item) => {
        return item.entrustOrganizationId == val;
      });
      if (!obj) {
        this.form.contactsName = null;
        this.form.organizationAddress = null;
        this.form.contactsMobile = null;
        this.form.agreementNumber = null;
        this.agreementList = [];
        return;
      }
      this.form.contactsName = obj.contactsName;
      this.form.organizationAddress = obj.addressDetails;
      this.form.contactsMobile = obj.contactsMobile;
      this.$set(this.form, "agreementId", null);
      this.$set(this.form, "agreementNumber", null);
    },
    // 更改合同下拉
    changeAgreement(val) {
      let obj = this.agreementList.find((item) => {
        return item.agreementNumber == val;
      });
      if (obj) {
        this.$set(this.form, "agreementId", obj.agreementId);
      }
    },
    // 切换tab栏
    changeTab(tab, event) {
      console.log("切换tab栏", tab.name);
      this.queryParams.tasksState = tab.name;
      this.dataList = [];
      this.getList();
    },
    // 切换弹框tab栏
    changeTabEquipment(tab, event) {
      this.$nextTick(() => {
        // window.MathJax.Hub.Queue(["Typeset", window.MathJax.Hub, document.getElementById('app')]);
        window.MathJax.Hub.Queue([
          "Typeset",
          window.MathJax.Hub,
          document.getElementsByTagName("i"),
        ]);
        // window.MathJax.Hub.Queue(["Typeset", window.MathJax.Hub, document.body]);
        // MathJax.typesetPromise();
        let findobj = this.scrollTopList.find((item) => {
          return item.name == tab.name;
        });
        if (findobj) {
          this.$refs["scrollref"].scrollTop = findobj.scrollTop;
        } else {
          this.$refs["scrollref"].scrollTop = 0;
        }
        this.isonblur = false;
      });
    },
    // 提交任务
    submitForm() {
      this.$refs["form"].validate((valid) => {
        if (!valid) return;
        let deleteIds = this.deletePerson.map((item) => {
          return {
            id: item.taskPersonalResultId,
            dosageType: item.dosageType,
          };
        });
        if (this.status == "1") {
          let form = {
            entrustOrganizationId: this.form.entrustOrganizationId,
            agreementId: this.form.agreementId,
            wearingBeginTime: this.form.wearingBeginTime,
            wearingEndTime: this.form.wearingEndTime,
            deleteItems: deleteIds,
          };
          personalDosimeterAdd(form).then((response) => {
            this.$modal.msgSuccess("新增成功");
            this.dialogVisible = false;
            this.getList();
          });
        }
      });
    },
    // 分页获取人员（添加时根据单位id）
    getListAdd() {
      this.queryParamsAdd.entrustOrganizationId = this.addId;
      this.loadingAdd = true;
      getWorkingPersonnelByOrganizationId(this.queryParamsAdd)
        .then((response) => {
          this.form.taskPersonalDosimeterResultList = response.rows;
          if (this.form.taskPersonalDosimeterResultList.length != 0) {
            let obj = this.form.taskPersonalDosimeterResultList[0];
            if (obj.wearingBeginTime) {
              this.$set(this.form, "wearingBeginTime", obj.wearingBeginTime);
            }
            if (obj.wearingEndTime) {
              this.$set(this.form, "wearingEndTime", obj.wearingEndTime);
            }
          }
          this.totalAdd = response.total;
          this.loadingAdd = false;
        })
        .catch((response) => {
          this.loadingAdd = false;
        });
    },
    // 提交办理/保存
    launch(type) {
      let form = {
        id: this.handleform.taskPersonalDosimeterId,
        wearingBeginTime: this.handleform.wearingBeginTime,
        wearingEndTime: this.handleform.wearingEndTime,
        agreementId: this.handleform.agreementId,
        operation: type,
        operationList: this.handleform.operationList,
      };
      personalDosimeterHandle(form).then((response) => {
        this.$modal.msgSuccess("操作成功");
        this.dialogVisiblehandle = false;
        this.getList();
      });
    },
    // 更改单位（添加时）
    changeEntrustOrganizationId(val) {
      this.addId = val;
      let obj = this.entrustOrganizationSelect.find((item) => {
        return item.entrustOrganizationId == val;
      });
      if (!obj) {
        this.form = {
          taskPersonalDosimeterResultList: [],
        };
        this.agreementList = [];
        return;
      }
      this.$set(this.form, "contactsName", obj.contactsName);
      this.$set(this.form, "contactsMobile", obj.contactsMobile);
      this.$set(this.form, "monitoringCycle", obj.monitoringCycle);
      this.$set(this.form, "monitoringState", obj.monitoringState);
      this.$set(this.form, "organizationAddress", obj.addressDetails);
      this.$set(this.form, "formDate", null);
      getAgreementListWithTaskDosimeter({ entrustOrganizationId: val }).then(
        (response) => {
          this.agreementList = response.data;
        }
      );
      this.getListAdd();
    },
    // 删除
    handleDelete(row) {
      this.$modal
        .confirm(`是否确认删除任务 [${row.agreementNumber}]？`)
        .then(() => {
          this.loading = true;
          return personalDosimeterRemove(row.taskPersonalDosimeterId);
        })
        .then(() => {
          this.loading = false;
          this.$modal.msgSuccess("删除成功");
          this.getList();
        })
        .finally(() => {
          this.loading = false;
        });
    },
    // 查询重置
    reset() {
      this.queryParams = {
        pageNum: 1,
        pageSize: 10,
      };
      this.resetForm("queryParams");
      this.getList();
    },
    // 更改勾选
    handleSelectionChange(selection) {
      this.selected = selection;
    },
    // 生成报告
    generateReport(row, type = 1) {
      if (type === 1) {
        generateInputReport(row.taskDetectionEquipmentResultId).then(
          (response) => {
            if (response.data) {
              listByIds(response.data).then((response) => {
                if (response.data[0]) {
                  const a = document.createElement("a");
                  a.style.display = "none";
                  a.setAttribute("target", "_blank");
                  a.setAttribute("download", "设备检测报告");
                  a.href = response.data[0].url;
                  document.body.appendChild(a);
                  a.click();
                  document.body.removeChild(a);
                }
              });
            }
          }
        );
      } else if (type === 2) {
        generateTestReport(row.taskDetectionEquipmentResultId).then(
          (response) => {
            if (response.data) {
              listByIds(response.data).then((response) => {
                if (response.data[0]) {
                  const a = document.createElement("a");
                  a.style.display = "none";
                  a.setAttribute("target", "_blank");
                  a.setAttribute("download", "设备检测报告");
                  a.href = response.data[0].url;
                  document.body.appendChild(a);
                  a.click();
                  document.body.removeChild(a);
                }
              });
            }
          }
        );
      }
    },
    // 更改检测类别
    // changeInspectId(row) {
    // 	console.log("更改检测类别", row);
    // 	let arr = [];
    // 	if(row.CG.length != 0) {
    // 		arr.push(...row.CG);
    // 	}
    // 	if(row.FH.length != 0) {
    // 		arr.push(...row.FH);
    // 	}
    // 	if(row.radioInspecId) {
    // 		arr.push(row.radioInspecId);
    // 	}
    // 	updateInspectionType({
    // 		resultId: row.taskDetectionEquipmentResultId,
    // 		inspectionTypeId: arr.join(","),
    // 	}).then((response) => {
    // 		this.$modal.msgSuccess("修改成功");
    // 	});
    // },
    // 单选框可取消
    handleChangeRadioInspecId(changeId) {
      // console.log("单选框可取消");
      // let newRow = {...row, radioInspecId: row.radioInspecId === changeId ? '' : changeId}
      // this.$set(this.form.tasksContractEquipmentList, index, newRow);
      // this.changeInspectId(newRow);
      this.$set(
        this.addlineForm,
        "radioInspecId",
        this.addlineForm.radioInspecId === changeId ? "" : changeId
      );
    },
  },
};
</script>

<style lang="scss" scoped>
.uploadbutton {
  padding-inline: 20px;
}
.myupload {
  margin-bottom: 20px;
}
.result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
  .calc {
    width: min-content;
    margin-left: 20px;
    .el-button {
      margin: 0;
      &:nth-of-type(1) {
        margin-bottom: 10px;
      }
    }
  }
}
.nametitle {
  text-align: center;
  margin-bottom: 10px;
  font-weight: bolder;
  &::before {
    content: "* ";
    color: red;
  }
}
::v-deep .el-table .warning-row {
  color: red;
}

.searchcontainer {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-top: -10px;
}
.viewform {
  justify-content: flex-end;
}
.title {
  padding-left: 10px;
  border-left: 5px solid #2a72ee;
  text-align: left;
  font-weight: bolder;
  font-size: 16px;
  margin-bottom: 30px;
}
.operation {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  .editform {
    .el-form-item {
      margin-bottom: 0;
    }
  }
}
.opration {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 10px;
  .filelist {
    margin: 0 auto 0 0;
    margin-left: 30px;
    font-weight: bolder;
    .filelistitem {
      color: #2a72ee;
      cursor: pointer;
      &:hover {
        color: #2a72ee;
        text-decoration: underline;
      }
    }
  }
}
.codecontainer {
  width: 5cm;
  height: 10cm;
  .item {
    color: red;
    font-size: 12px;
  }
}

// 生成图片样式
.printmy {
  position: relative;
  font-size: 10px;
  background-color: aqua;
  width: 50mm;
  height: 23mm;
  margin-bottom: 5mm;
  padding: 2mm;
  .barcode {
    position: absolute;
    top: 2mm;
    right: 3mm;
  }
}
::v-deep .handletabel.el-table {
  margin-bottom: 60px;
  overflow: auto;
  .el-table__body-wrapper {
    overflow-y: auto;
    overflow-x: hidden;
  }
}
::v-deep .handletabelaudit.el-table {
  margin-top: -35px;
}
.flowdialog .el-tabs {
  height: 700px;
  overflow: auto;
}
.blbtn {
  margin-right: 50px;
}
.bldialog ::v-deep .el-dialog__body {
  position: relative;
}
.addtask ::v-deep .el-dialog__body {
  position: relative;
}
.wearingedit ::v-deep .el-input__inner {
  padding-right: 0;
}
.selectperson ::v-deep .el-input__inner {
  padding-right: 7px;
}

.dialogVisibleEquipment {
  ::v-deep .el-dialog__body {
    padding-bottom: 10px;
  }
  .el-textarea__inner {
    border-radius: 0;
  }
  .tabEquipment {
    padding-inline: 10px;
    margin-top: -10px;
  }
}

// 检测项目
.content {
  overflow: auto;
  max-height: 600px;
  padding-inline: 20px 10px;
  &::-webkit-scrollbar-track-piece {
    background: #d3dce6;
  }

  &::-webkit-scrollbar {
    width: 6px;
  }

  &::-webkit-scrollbar-thumb {
    background: #99a9bf;
    border-radius: 20px;
  }
}
.mask {
  position: relative;
  &::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    /* height: 100%; */
    right: 0;
    z-index: 999;
    cursor: not-allowed;
    left: 0;
    background: #fff0;
  }
}
.viewfile {
  color: #2a72ee;
  cursor: pointer;
  // margin-right: 10px;
  &:hover {
    text-decoration: underline;
  }
}
.addline {
  float: right;
  padding-inline: 20px;
  transform: translateY(-7px);
  margin-bottom: 5px;
}
.loadingquery {
  position: absolute;
  top: 70px;
  right: 120px;
  ::v-deep .el-loading-spinner .circular {
    height: 30px;
    width: 30px;
  }
  .progressbox {
    display: flex;
    align-items: center;
    .isloading {
      width: 27px;
      height: 36px;
      ::v-deep .el-loading-mask {
        z-index: 0;
      }
    }
  }
}
.inspect {
  display: flex;
  align-items: center;
  // justify-content: center;
  margin-left: 30px;
  .inspectcheckbox {
    margin-right: 20px;
    display: flex;
    align-items: center;
  }
  .inspectradio {
    transform: translateY(1px);
    .el-radio {
      margin-right: 13px;
    }
  }
}
::v-deep .star .el-form-item__label::before {
  content: "* ";
  color: red;
}
.cusoperation .el-button--medium {
  padding-block: 0;
}
::v-deep .el-button.ovbutton {
  padding-block: 0;
}

</style>
